import 'package:flutter/material.dart';
import 'package:flutterappmydemo/wxread/base_card.dart';

class CardShare extends BaseCard {
  @override
  _CardShareState createState() => _CardShareState();
}

class _CardShareState extends BaseCardState {
  @override
  void initState() {
    //subTitleColor = Color(0xffb99444);
    super.initState();
  }

  @override
  topTitle(String title) {
    return super.topTitle("分享得联名卡");
  }

  @override
  topTitle2(String title) {
    return Padding(
      padding: EdgeInsets.only(bottom: 5),
      child: Text(
        '/ 第19期',
        style: TextStyle(fontSize: 10),
      ),
    );
  }

  @override
  Widget subTitle(String title) {
    return super.subTitle("分享到朋友圈最多可的12天无效卡");
  }

  @override
  bottomContent() {
    return Expanded(
      child: Container(
        margin: EdgeInsets.only(top: 20),
        decoration: BoxDecoration(color: Color(0xfff6f7f9)),
        child: Column(
          //crossAxisAlignment: CrossAxisAlignment.end,
          children: [
            Expanded(
              child: Padding(
                padding: EdgeInsets.only(top: 20, left: 15, bottom: 20),
                child: Image.network(
                  "http://www.devio.org/io/flutter_beauty/card_list.png",
                  fit: BoxFit.cover,
                ),
              ),
            ),

            //测试发下新版本已不存在这个问题了，会填满整个容器的
            /*Container(
              //重写父布局的位置约束，位于父布局中间
              alignment: AlignmentDirectional.center,
              child: Padding(
                padding: EdgeInsets.only(bottom: 20),
                child: bottomTitle("20555555444人 · 参与活动"),
              ),
            ),*/

            Padding(
              padding: EdgeInsets.only(bottom: 20),
              child: bottomTitle("20555555444人 · 参与活动"),
            ),

          ],
        ),
      ),
    );
  }
}
